
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

import com.alibaba.fastjson.JSON;
import com.bootdo.common.utils.DateUtils;
import com.bootdo.common.utils.HttpUtil;
import com.bootdo.common.utils.MD5Utils;
import com.bootdo.common.utils.StrUtil;
import com.bootdo.system.config.KswApi;
import com.bootdo.system.dto.ProductDto;


public class cc {
	
	 public static void main(String[] args) {
//		 try {
//				String host1 = "http://www.kashangwl.com";
//				String success = "/api/customer";
//				String key="8a4b303cb5a6500a08e174d445b941d1";
//				String customer_id="1191202";
//				SimpleDateFormat df = new SimpleDateFormat("yyyyMMddhhss");//设置日期格式
//				String timestamp = df.format(new Date());// new Date()为获取当前系统时间，也可使用当前时间戳
//				String md5 = strUtil.getMd5(key + "customer_id" + customer_id+"timestamp"+timestamp);
//				   TreeMap<String, String> treeMap = new TreeMap<String, String>();
//				   treeMap.put("customer_id" , customer_id);
//				   treeMap.put("timestamp" , timestamp);
//				   treeMap.put("sign" , md5);
//				
//				String s = HttpUtil.doPost(host1 + success,treeMap,null);
//				System.out.println(s);
//			} catch (Exception e) {
//				e.printStackTrace();
//			}
		 String key="8a4b303cb5a6500a08e174d445b941d1";
		 String customer_id="1191202";
		 int product_id=37901;
		 String timestamp = getTimestamp();
		  String md5 = StrUtil.getMd5(key +"customer_id" + customer_id+ "product_id" + product_id+"timestamp"+timestamp);
		  TreeMap<String, String> treeMap = new TreeMap<String, String>();
		   treeMap.put("product_id" , product_id+"");
		   treeMap.put("timestamp" , timestamp);
		   treeMap.put("customer_id" , customer_id);
		   treeMap.put("sign" , md5);
		   String s = HttpUtil.doPost(KswApi.KSW_PRODUCT_RECHARGE_PARAMS,treeMap,null);
		   System.out.println(s);
	}
	 
	 private static String getTimestamp() {
			SimpleDateFormat df = new SimpleDateFormat("yyyyMMddhhss");//设置日期格式
			String timestamp = df.format(new Date());
			return timestamp;
		}

}
